﻿/*
Copyright © 2010 François Karman

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

See <license.txt> for the complete license of the software.
*/

using System;
using Microsoft.Build.Framework;

namespace MSBuild.Mercurial
{
    /// <summary>
    /// Adds a tag on a Hg workspace for a specific revision.
    /// </summary>
    /// <remarks>
    /// <para>
    /// This method use the <c>hg tag</c> command.
    /// </para>
    /// <para>
    /// This task doesn't implement the <c>remove</c> parameter
    /// of the <c>hg tag</c> command.
    /// </para>
    /// </remarks>
    [Command("tag")]
    public class HgTag : AbstractHgTask
    {
        /// <summary>
        /// Initializes a new instance of the HgTag class.
        /// </summary>
        public HgTag()
        {
        }

        /// <summary>
        /// Gets or sets a value indicating whether the tag
        /// should be forced and replace existing tag.
        /// </summary>
        [Parameter("-f")]
        public bool Force { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the tag
        /// is only local and not shared with other repositories.
        /// </summary>
        [Parameter("-l")]
        public bool Local { get; set; }

        /// <summary>
        /// Gets or sets the revision to tag.
        /// </summary>
        /// <remarks>
        /// This value could be a revision number or a changeset id.
        /// </remarks>
        [Parameter("-r")]
        public string Revision { get; set; }

        /// <summary>
        /// Gets or sets a specific commit date.
        /// </summary>
        [Parameter("-d")]
        public DateTime? Date { get; set; }

        /// <summary>
        /// Gets or sets the commit message.
        /// </summary>
        [Parameter("-m")]
        public string Message { get; set; }

        /// <summary>
        /// Gets or sets the commit user.
        /// </summary>
        [Parameter("-u")]
        public string User { get; set; }

        /// <summary>
        /// Gets or sets the name of the tag.
        /// </summary>
        [Required]
        [Parameter("")]
        public string Tag { get; set; }
    }
}
